package ch.fusun.baron.treasury;

import ch.fusun.baron.core.injection.Inject;
import ch.fusun.baron.data.DataUpdate;
import ch.fusun.baron.treasury.api.TreasuryService;

/**
 *
 */
public class SetMoneyDataUpdate implements DataUpdate {

	@Inject
	private transient TreasuryService treasuryService;
	private int money;
	private Object owner;

	/**
	 * Kryo
	 */
	public SetMoneyDataUpdate() {
	}

	/**
	 * @param money
	 *            the money
	 */
	public SetMoneyDataUpdate(Object owner, int money) {
		this.money = money;
		this.owner = owner;
	}

	@Override
	public void update() {
		treasuryService.setMoney(owner, money);
	}

}
